package cn.groupmarket.test.logicLink.test;

import cn.groupmarket.api.response.Response;
import cn.groupmarket.test.logicLink.model1.factory.Rule01TradeRuleFactory;
import cn.groupmarket.test.logicLink.model2.factory.Rule02TradeRuleFactory;
import cn.groupmarket.types.design.framework.link.model1.ILogicLink;
import cn.groupmarket.types.design.framework.link.model2.chain.BusinessLinkedList;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class Link01Test {

    @Resource
    private Rule01TradeRuleFactory rule01TradeRuleFactory;

    @Test
    public void test1() throws Exception {
        ILogicLink<String, Rule01TradeRuleFactory.DynamicContext, Response<String>> stringDynamicContextResponseILogicLink = rule01TradeRuleFactory.openLogicLink();
        Response<String> logic = stringDynamicContextResponseILogicLink.apply("123",new Rule01TradeRuleFactory.DynamicContext());
        log.info("logic:{}",logic);

    }


}
